home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_shakeybridge.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  89 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_shakeyBridge.cog
  4. #
  5. # [CM]
  6. #
  7. # Random screenshakes for unstable areas.
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15. #........................MESSAGES....................
  16.     message        entered
  17.     message        user0
  18.  
  19. #........................COGS....................
  20.     cog            nextTile
  21.    
  22. #........................ACTORS....................
  23.     thing        player                            local
  24.     
  25.  
  26. #........................TRIGGERS....................
  27.     thing        floor1    linkID=2                
  28.     
  29. #........................PROPS....................
  30.     thing        fragment1                        local                
  31.     thing        fragment2                        local                
  32.                 
  33. #........................VARIABLES....................
  34.     flex        shake                            local
  35.     int            rumblesound                        local
  36.     int            dir                                local
  37.     int            hit=0                            local
  38.     int            i=0                                local
  39.     
  40. #........................TEMPLATES....................
  41.     template    debris=stoneshrapa                local
  42.  
  43. #........................SOUNDS....................
  44.     sound        quake=nub_bull_move1_c.wav        local
  45.  
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51.  
  52. entered:
  53.  
  54.     If (GetSenderRef() == floor1) 
  55.         {
  56. user0:        If (hit == 0)
  57.             {
  58.             hit = 1;
  59.             rumblesound=PlaySoundLocal(quake, 1, 0, 0x01, 0);
  60.             for (i=0 ; i <= 10 ; i = i + 1) 
  61.             {
  62.             dir=RandBetween(0, 1);
  63.             #SetPOVShake('0.0 0.0 0.0', '0.0 0.0 0.005', 80.0, 0.80);
  64.             Rotate(floor1, 3, dir, .05);
  65.             Sleep(0.06);
  66.             Rotate(floor1, -6, dir, .05);
  67.             Sleep(0.06);
  68.             }
  69.             
  70.             SendMessage(nextTile, user0);
  71.             StopSound(rumblesound, 0.5);
  72.             
  73.             fragment1 = CreateThing(debris, floor1);                                 
  74.             fragment2 = CreateThing(debris, floor1);
  75.             SetThingMass(fragment1, 1);
  76.             SetThingMass(fragment2, 1);
  77.             SetThingVel(fragment1, VectorSet(RandBetween(0, 4)/10, RandBetween(0, 2)/10, -.5));
  78.             SetThingVel(fragment2, VectorSet(RandBetween(0, 4)/10, RandBetween(0, 2)/10, -.5));
  79.             SetThingRotVel(fragment1, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 100.0));
  80.             SetThingRotVel(fragment2, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 100.0));
  81.  
  82.             DestroyThing(floor1);
  83.             }
  84.         }
  85. return;
  86. # ========================================================================================
  87. end
  88.  
  89.